﻿using Org.BouncyCastle.Crypto;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zhaoxi.SqlSugar.Models
{
    public class Tree
    {
        [SugarColumn(IsPrimaryKey = true)]
        public int Id { get; set; }
        public string? Name { get; set; }
         
        public int ParentId { get; set; } //在树查询中Parentid 是特殊的；

        [SugarColumn(IsIgnore = true)]

        [Navigate(NavigateType.OneToMany, nameof(ParentId))]//设置导航 一对多关系
        public List<Tree>? Child { get; set; }
    }
}
